package main.java.study.step02;

/**
 * @author liuwenxiu
 * @Description:
 * @date 2022-7-13 14:29
 */
public class StaticMethodDemo {
    
    private static String str1 = "static";
    private String str2 = "normal";
    
    public static void print(){
        System.out.println("这是一个静态方法");
        System.out.println(str1);
//        System.out.println(str2);   //error 获取不到str2
        
    }
    
    public void print2(){
        System.out.println("这是一个普通方法");
        System.out.println(str1);
        System.out.println(str2);
        print();
    }
    
    public static void main(String[] args) {
        StaticMethodDemo.print();
        StaticMethodDemo demo = new StaticMethodDemo();
        demo.print2();
    }
}
